package com.wxtl.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.wxtl.dao.ProductDAO;
import com.wxtl.entity.Product;
import com.wxtl.util.DataGridModel;
import com.wxtl.util.Page;

@Service
public class ProductService {
	private ProductDAO productDAO;

	public ProductDAO getProductDAO() {
		return productDAO;
	}

	public void setProductDAO(ProductDAO productDAO) {
		this.productDAO = productDAO;
	}
	
	public List<Product> getAllProduct(){
		return productDAO.getAllProduct();
	} 
	
	
	public Page query(DataGridModel dgm,Product product){
		return productDAO.query(dgm,product);
	}
	
	public void delete(int[] ids){
		productDAO.delete(ids);
	}
	
	public Product getProductById(int id){
		return productDAO.load(id);
	}
	
	public void add(Product product){
		productDAO.add(product);
	}
	
	public void update(Product product){
		productDAO.update(product);
	}
}
